color-editor: don't use a GtkAlignment to layout popups
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 9 Feb 2012 19:25:53 +0000 (14:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Feb 2012 21:37:01 +0000 (16:37 -0500)
Set a margin on the contents and use a box instead.

gtk/gtkcoloreditor.c

index bcf475793a4c381d8d38d4b989baa9bfe9844454..923c2726c6e01c15c20010ba5ba4aca59af2133e 100644 (file)
@@ -44,7 +44,6 @@
 #include "gtkadjustment.h"
 #include "gtklabel.h"
 #include "gtkspinbutton.h"
-#include "gtkalignment.h"
 #include "gtkintl.h"
 
 #include <math.h>
@@ -352,14 +351,13 @@ create_popup (GtkColorEditor *editor,
 {
   GtkWidget *popup;
 
-  popup = gtk_alignment_new (0.5, 0.5, 0, 0);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (popup), 12, 12, 12, 12);
-  gtk_style_context_add_class (gtk_widget_get_style_context (popup), GTK_STYLE_CLASS_TOOLTIP);
+  g_object_set (contents, "margin", 12, NULL);
 
+  popup = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_style_context_add_class (gtk_widget_get_style_context (popup), GTK_STYLE_CLASS_TOOLTIP);
   gtk_container_add (GTK_CONTAINER (popup), contents);
 
-  gtk_widget_show_all (popup);
-  gtk_widget_hide (popup);
+  gtk_widget_show_all (contents);
   gtk_widget_set_no_show_all (popup, TRUE);
 
   g_signal_connect (popup, "draw", G_CALLBACK (popup_draw), editor);